* (T109121) Remove deprecated pear/mail_mime-decode from composer suggested libraries.
* (T200595) Fix PHP 7.3 warnings of using "continue" in some scenarios instead
of "break".
+* (T206979) Fix PHP 7.3 warnings of using "compact()" when some variables may
+ not be set.
== MediaWiki 1.31.1 ==
ini_set( 'apc.cache_by_default', $_apcEnabled );
Wikimedia\restoreWarnings();
+ $data = [];
if ( $_fileType == 'core' || $_fileType == 'extension' ) {
- $data = compact( self::$allKeys );
+ foreach ( self::$allKeys as $key ) {
+ // Not all keys are set in language files, so
+ // check they exist first
+ if ( isset( $$key ) ) {
+ $data[$key] = $$key;
+ }
+ }
} elseif ( $_fileType == 'aliases' ) {
- $data = compact( 'aliases' );
+ if ( isset( $aliases ) ) {
+ /** @suppress PhanUndeclaredVariable */
+ $data['aliases'] = $aliases;
+ }
} else {
throw new MWException( __METHOD__ . ": Invalid file type: $_fileType" );
}